<?php
// 连接数据库等操作
require_once 'databaseConnection.php';
if (isset($_POST['predetermineId'])) {
    $predetermineId = $_POST['predetermineId'];
    // 已经建立了与数据库的连接
    $pdo = connectToDatabase();
    // 准备删除语句
    $query = 'DELETE FROM predetermine WHERE predetermine_id = :predetermineId';
    $statement = $pdo->prepare($query);
    // 绑定参数
    $statement->bindParam(':predetermineId', $predetermineId, PDO::PARAM_INT);
    // 执行删除
    $result = $statement->execute();
    if ($result) {
        echo json_encode(['status' => 'success']);
    } else {
        echo json_encode(['status' => 'error', 'message' => '无法更新数据']);
    }
} else {
    echo json_encode(['status' => 'error', 'message' => '无效请求']);
}
?>